import { createTheme } from '@/theme/theme_class'
import { createPinia } from 'pinia'
import { UserInfo } from '../stores/userInfo'
import { getax } from '../common/request'

export function baseLoader(app) {
    createTheme()


    getax('api/index/info').then((response) => {
        const userinfo = UserInfo()
        try {
            userinfo.userId = response.data.data.userId
        } catch {
            console.log('未获取到token')
        }
        
    }).then((err) => {
        if (err) {
            console.log(err)
        } 
    })
    app.use(createPinia())
}

